#!/usr/bin/env python
# -*- coding:utf-8 -*-

# https://blog.csdn.net/qq_41556318/article/details/85596217
# Spinbox 组件（Tk8.4 新增）是 Entry 组件的变体，用于从一些固定的值中选取一个。
# Spinbox 组件通常用于在限定数字中选取的情况下代替普通的 Entry 组件。
# 注意：Spinbox 组件仅支持 Python2.3 和 Tk8.4 以上版本。


import tkinter as tk


def test_1():
    root = tk.Tk()

    w = tk.Spinbox(root, from_=0, to=10)
    w.pack()

    root.mainloop()


def test_2():
    root = tk.Tk()

    w = tk.Spinbox(root, values=("小新", "风间", "正男", "妮妮", "阿呆"))
    w.pack()

    root.mainloop()


def main():
    from public_function import dict_choice
    choice = str(input("Enter a positive integer to choice: "))
    if choice in dict_choice.keys():
        exec(dict_choice[choice])
    else:
        print("输入有误，请重输！", choice)


if __name__ == "__main__":
    main()
